/*
 *  F1.h
 *  Genetski
 *
 *  Created by Srđan Rašić on 11/19/11.
 *
 */

#pragma once
#include "Function.h"
#include <utility>

class F1 : public Function {
public:
	virtual double operator() (std::vector<double> vec) const {
		return (vec[0]-2)*(vec[0]-2);	// (x-2)^2 => min=2
	}
	
	virtual std::pair<double, double> Domain() const {
		return std::make_pair(-15, 15);
	}
	
	virtual unsigned int Dimensions() const {
		return 1;
	}
};